#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int arr[N];
int n, m;
int main()
{
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	sort(arr, arr + n);
	int mi = 0;
	//2 8 13
	for (int i = n - 1; i >= 0; i--) {
		while (m) {
			mi += arr[i] / 2;
			arr[i] /= 2;
			if (arr[i] < arr[i - 1]) {
				break;
			}
			m--;
		}
	}
	cout << mi << endl;	
	return 0;
}